package com.zwj.design.creating.absfactory.app;

import com.zwj.design.creating.absfactory.buttons.Button;
import com.zwj.design.creating.absfactory.checkboxes.Checkbox;
import com.zwj.design.creating.absfactory.factories.GUIFactory;

/**
 * 客户端
 *
 * @author 张文接
 * @version 1.0
 * @createTime 2024/3/13 15:22
 */
public class Application {
    private Checkbox checkbox;
    private Button button;

    /**
     * 初始化
     * @param factory 工厂
     */
    public Application(GUIFactory factory) {
        button = factory.createButton();
        checkbox = factory.createCheckbox();
    }

    /**
     * 绘画
     */
    public void paint() {
        button.paint();
        checkbox.paint();
    }
}
